package org.yzh.protocol;

import io.github.yezhihao.protostar.DataType;
import io.github.yezhihao.protostar.annotation.Field;
import io.github.yezhihao.protostar.annotation.Message;
import org.yzh.protocol.basics.GTMessage;
import org.yzh.protocol.commons.GTID;

import java.time.LocalDateTime;

/**
 * @author yezhihao
 * @home https://gitee.com/yezhihao/jt808-server
 */
@Message(GTID.车辆登入)
public class PlatformLogin extends GTMessage {

    @Field(index = 0, type = DataType.BYTES, length = 6, desc = "平台登入时间")
    private LocalDateTime deviceTime;
    @Field(index = 8, type = DataType.WORD, desc = "登入流水号")
    private int serialNo;
    @Field(index = 10, type = DataType.STRING, length = 12, desc = "平台用户名")
    private String username;
    @Field(index = 22, type = DataType.STRING, length = 20, desc = "平台密码")
    private String password;
    @Field(index = 42, type = DataType.BYTE, desc = "加密规则")
    private int encryptionRule;

    public LocalDateTime getDeviceTime() {
        return deviceTime;
    }

    public void setDeviceTime(LocalDateTime deviceTime) {
        this.deviceTime = deviceTime;
    }

    @Override
    public int getSerialNo() {
        return serialNo;
    }

    public void setSerialNo(int serialNo) {
        this.serialNo = serialNo;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getEncryptionRule() {
        return encryptionRule;
    }

    public void setEncryptionRule(int encryptionRule) {
        this.encryptionRule = encryptionRule;
    }
}